package com.example.chatroom.dao.mapper;

import com.example.chatroom.dao.dataobject.UserDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    int insert(UserDO row);

    int insertSelective(UserDO row);

    UserDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserDO row);

    int updateByPrimaryKey(UserDO row);

    /**
     * 根据用户名查询用户信息
     * @param userName
     * @return
     */
    UserDO selectByUserName(@Param("userName") String userName);

    /**
     * 模糊查询 根据str查询用户名称
     * @param str
     * @return
     */
    List<String> selectUserNameByStr(@Param("str") String str,@Param("userId")Long userId);
}